<?php

/**
 * Created by PhpStorm.
 * User: liu
 * Date: 2018/9/25
 * Time: 0:38
 */
class Commodity
{
public $name,$number,$price;
function Selfintroduction()
{
    echo "名稱".$this->name."<br>"."庫存".$this->number."<br>"."價格".$this->price."<br>";

}

}
class Cellphone extends Commodity
{
    public $brand,$place;
    function Selfintroduction()
    {
        parent::Selfintroduction();
        echo "<br>品牌".$this->brand."<br>產地".$this->place."<br>";

    }
}
class Book extends Commodity
{
    public $writer,$press;
    function Selfintroduction()
    {
        parent::Selfintroduction();
        echo "<br>作者".$this->writer."<br>".$this->press;
    }
}